package com.woniuxy.happylife.order.dao;

import com.woniuxy.happylife.entity.MallOrder;
import com.woniuxy.happylife.entity.MallOrderItem;
import com.woniuxy.happylife.entity.Order;

import java.util.List;

/**
 * @Title: OrderDao
 * @ProjectName: happy-life
 * @Description: TODO
 * @Author: chowinggum
 * @Date: 2022/2/18 14:27
 */
public interface OrderDao {
    //添加订单
    int add(Order order);
//根据订单号查订单
    MallOrder findByOrderno(String orderno);
    //分页查询
//public List<Order> findPageByUid(@Param("uid")int uid,@Param("index")int index);
    //对应用户订单总数
    int countByUid(int uid);
    //查询用户所有订单
    List<MallOrder> findByUid(int uid);
    //查询用户前四个订单
    List<MallOrder> findpartByUid(int uid);
//在orderitme表中添加订单详情数据，一个订单中有多个物品
    int addItem(MallOrderItem orderitem);
    //通过订单id查订单中的所有物品
    List<MallOrderItem> findItemByOrderId(int oid);
    //通过订单号删除订单
    int delOrder(String orderno);
}
